#include "MainFrame/SettingDock/PaletteDock/PaletteLabel.h"
#include <QMouseEvent>

PaletteLabel::PaletteLabel(QWidget *parent, Qt::WindowFlags f):
    QLabel(parent, f)
{
    this->setMouseTracking(true);
    this->setCursor(QCursor(Qt::CrossCursor));
}

PaletteLabel::~PaletteLabel()
{

}

void PaletteLabel::mousePressEvent(QMouseEvent *ev)
{
    if(ev->buttons() == Qt::LeftButton)
    {
        QPoint p(ev->pos().x(), ev->pos().y());
        emit CursorPosChanged(p);
    }
}

void PaletteLabel::mouseMoveEvent(QMouseEvent *ev)
{
    if(ev->buttons() == Qt::LeftButton)
    {
        QPoint p(ev->pos().x(), ev->pos().y());
        emit CursorPosChanged(p);
    }
}
